using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class ThemUser : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btn_TaoMoi_Click(object sender, EventArgs e)
    {
        

    }

    public void LayThongTin(NguoiDung_Info info)
    {
        //NguoiDung_Info info= new NguoiDung_Info()
        info.TenDangNhap=txt_Username.Text;
        info.HoTen=txt_HoTen.Text;
        info.MatKhau=txt_Pass.Text;
        info.Email=txt_Email.Text;
        info.DiaChi=txt_DiaChi.Text;
        info.DienThoai=txt_DienThoai.Text;
        info.SoTaiKhoan=txt_SoTK.Text;
        info.Fax=txt_Fax.Text;

        if(cbx_Admin.Checked)
            info.MaPhanQuyen=1;
        else
            info.MaPhanQuyen=2;

        //return info;
    }
    protected void btn_XoaTrang_Click(object sender, EventArgs e)
    {
        
    }
    protected void btn_TaoMoi_Click1(object sender, EventArgs e)
    {
        NguoiDung_Ctl ND = new NguoiDung_Ctl();
        LayThongTin(ND.Info);
        ND.insert();
    }
    protected void btn_XoaTrang_Click1(object sender, EventArgs e)
    {
        txt_Username.Text = "";
        txt_Pass.Text = "";
        txt_Email.Text = "";
        txt_SoTK.Text = "";
        txt_HoTen.Text = "";
        txt_DiaChi.Text = "";
        txt_DienThoai.Text = "";
        txt_Fax.Text = "";
    }
}
